//
//  YRJFindNextStationForAllWebViewController.m
//  YanRenjie
//
//  Created by dllo on 15/10/27.
//  Copyright (c) 2015年 yanrenjie. All rights reserved.
//

#import "YRJFindNextStationForAllWebViewController.h"
#import "YRJTripHeader.h"

@interface YRJFindNextStationForAllWebViewController ()<UIWebViewDelegate>
@property(nonatomic, retain)MBProgressHUD *hud;
@end

@implementation YRJFindNextStationForAllWebViewController
- (void)dealloc {
    [_string release];
    
    [super dealloc];
}

- (void)viewWillAppear:(BOOL)animated {
    self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    self.hud.labelText = @"Loading...";
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    [self.view addSubview:webView];
    webView.delegate = self;
    webView.scalesPageToFit = YES;
    [webView release];
    
    NSURL *url = [NSURL URLWithString:self.string];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webView loadRequest:request];
    
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    self.hud.hidden = YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
